<?php

namespace App\Http\Controllers\Admin\Pages;

use App\Facades\ChargeRecordService;
use App\Facades\UserService;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Redis;

class ConfigController extends Controller
{
    public function price(Request $request)
    {
        $user = UserService::hasPermission(['finance']);
        $price = ChargeRecordService::getPrice();
        return view('admin/PriceConversionSet')->with(['price' => $price]);
    }

    public function bindMessage(Request $request)
    {
        $user = UserService::hasPermission(['admin']);
        $config = json_decode(Redis::get('bindMessage'), true);
        if(is_null($config)){
            $config = config('heting.template');
        }
        return view('admin/bindInforSet')->with(['config' => $config]);
    }

}
